package com.shigu.mo.bo;

import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class PayedCallbackBO extends YeepayCallbackBO{

    protected List<Part> parts = new ArrayList<Part>();

    private String requestId;
    private String customerNumber;
    private String externalId;
    private String createTime;
    private String payTime;
    private String amount;
    private String fee;
    private String status;
    private String busiType;
    private String bankCode;
    private String payerName;
    private String payerPhone;
    private String lastNo;
    private String src;
    private String hmac;

    private ArrayList<String> needHmac=new ArrayList<>(Arrays.asList(
            "code",
            "message",
            "requestId",
            "customerNumber",
            "externalId",
            "createTime",
            "payTime",
            "amount",
            "fee",
            "status",
            "busiType",
            "bankCode",
            "payerName",
            "payerPhone",
            "lastNo",
            "src"
    ));


    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.parts.add(new StringPart("requestId", requestId == null ? "" : requestId,
                "UTF-8"));
        this.requestId = requestId;
    }

    public String getCustomerNumber() {
        return customerNumber;
    }

    public void setCustomerNumber(String customerNumber) {
        this.parts.add(new StringPart("customerNumber", customerNumber == null ? "" : customerNumber,
                "UTF-8"));
        this.customerNumber = customerNumber;
    }

    public String getExternalId() {
        return externalId;
    }

    public void setExternalId(String externalId) {
        this.parts.add(new StringPart("externalId", externalId == null ? "" : externalId,
                "UTF-8"));
        this.externalId = externalId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.parts.add(new StringPart("createTime", createTime == null ? "" : createTime,
                "UTF-8"));
        this.createTime = createTime;
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(String payTime) {
        this.parts.add(new StringPart("payTime", payTime == null ? "" : payTime,
                "UTF-8"));
        this.payTime = payTime;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.parts.add(new StringPart("amount", amount == null ? "" : amount,
                "UTF-8"));
        this.amount = amount;
    }

    public String getFee() {
        return fee;
    }

    public void setFee(String fee) {
        this.parts.add(new StringPart("fee", fee == null ? "" : fee,
                "UTF-8"));
        this.fee = fee;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.parts.add(new StringPart("status", status == null ? "" : status,
                "UTF-8"));
        this.status = status;
    }

    public String getBusiType() {
        return busiType;
    }

    public void setBusiType(String busiType) {
        this.parts.add(new StringPart("busiType", busiType == null ? "" : busiType,
                "UTF-8"));
        this.busiType = busiType;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.parts.add(new StringPart("bankCode", bankCode == null ? "" : bankCode,
                "UTF-8"));
        this.bankCode = bankCode;
    }

    public String getPayerName() {
        return payerName;
    }

    public void setPayerName(String payerName) {
        this.parts.add(new StringPart("payerName", payerName == null ? "" : payerName,
                "UTF-8"));
        this.payerName = payerName;
    }

    public String getPayerPhone() {
        return payerPhone;
    }

    public void setPayerPhone(String payerPhone) {
        this.parts.add(new StringPart("payerPhone", payerPhone == null ? "" : payerPhone,
                "UTF-8"));
        this.payerPhone = payerPhone;
    }

    public String getLastNo() {
        return lastNo;
    }

    public void setLastNo(String lastNo) {
        this.parts.add(new StringPart("lastNo", lastNo == null ? "" : lastNo,
                "UTF-8"));
        this.lastNo = lastNo;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.parts.add(new StringPart("src", src == null ? "" : src,
                "UTF-8"));
        this.src = src;
    }


    public void setHmac(String hmac) {
        this.hmac = hmac;
    }

    @Override
    public Part[] generateParams() {
        return parts.toArray(new Part[parts.size()]);
    }

    @Override
    public String getHmac() {
        return this.hmac;
    }

    @Override
    public List<String> needHmacArr() {
        return needHmac;
    }
}
